package cn.may.easypoi;

import cn.afterturn.easypoi.word.WordExportUtil;
import org.apache.poi.xwpf.usermodel.XWPFDocument;

import java.io.OutputStream;
import java.util.Map;

/**
 * @author May
 * @date 2020/11/02 13:56
 * @desc
 */
public class WordUtil {

    public static String simpleWordExport(String tempLateFilePath, OutputStream outputStream, Map<String, Object> map) {

        try {
            XWPFDocument doc = WordExportUtil.exportWord07(tempLateFilePath, map);
            doc.write(outputStream);
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage(), e);
        }

        return "success";
    }
}
